#include "../HttpFixedResponse.h"
#include "../Route.h"
#include "../common/YXLog.h"
#include "../common/YXResult.h"
#include "../common/YXString.h"
#include "../service/ObjectsService.h"

YXResult *getObjectsHandler(Request *request, Response *response) {
    int num;
    char** queryValue = extract_values(request->path, &num);
    url_decode(queryValue[1]);
    return getObjects(atoi(queryValue[0]), queryValue[1]);
}

__attribute__((constructor)) void objectsControllerInit() { addRoute("GET", "/op/objects/**", NULL, getObjectsHandler); }
